package com.czz.manage.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.czz.manage.entity.CourseConsult;
import com.czz.manage.mapper.CourseConsultMapper;
import com.czz.manage.query.ConsultQuery;
import com.czz.manage.service.CourseConsultService;
import com.czz.manage.vo.ConsultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName: CourseConsultServiceImpl
 * @Author Czz
 * @Date 2020/2/19
 * @Time 10:29
 **/
@Service
public class CourseConsultServiceImpl extends ServiceImpl<CourseConsultMapper, CourseConsult> implements CourseConsultService {

    @Autowired
    CourseConsultMapper consultMapper;

    @Override
    public List<ConsultVo> getConsultPageList(Page<ConsultVo> pageParam,String id, ConsultQuery consultQuery) {
        return consultMapper.getConsultPageList(pageParam,id,consultQuery);
    }

    @Override
    public void updateConsultById(ConsultVo consultVo) {
        CourseConsult consult = new CourseConsult();
        consult.setConsultId(consultVo.getConsultId());
        consult.setReply(consultVo.getReply());
        consultMapper.updateById(consult);
    }
}
